from flask import Flask
from dbconfig import Config
from extensions import db
from controller.user_controller import user_bp

app = Flask(__name__)
app.config.from_object(Config)

# 初始化数据库
db.init_app(app)

# 注册蓝图
app.register_blueprint(user_bp)

if __name__ == '__main__':
    with app.app_context():
        db.create_all()  # 初始化数据库
    app.run(debug=True)
